#ifndef CAMERAPROVIDER_H
#define CAMERAPROVIDER_H

#include <QQuickImageProvider>
#include <QDebug>
#include <windows.h>
#include <QTimer>
#include <QImage>
#include <QDialog>
#include "HKCamera/head/HCNetSDK.h"
#include <QThread>
#include <QQmlApplicationEngine>

class Provider : public QObject, public QQuickImageProvider{
    Q_OBJECT
public:
    Provider();
    QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override;
    QImage* pm;

};

class CameraProvider : public QThread
{

    Q_OBJECT

public:
    CameraProvider(QQmlApplicationEngine* engine);

    void run() override;

    void startCamera();
    void startCapturing();
signals:
    void sigRefresh();

public slots:
    void captureImage();
public:

    bool        isConnected = false;

    Provider*  _provider;

    QTimer*     _timer = nullptr;
    QImage*      _image;


    // 摄像头参数
    LONG    lUserID = -1;
    HWND    hWnd;
    LONG    lRealPlayHandle = -1;

};




#endif // CAMERAPROVIDER_H
